package edu.practice;

import java.util.Scanner;
class Person {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person() {
        this.setName("none");
        this.setAge(1);
    }

    public Person(String name, int age) {
        this.setName(name);
        this.setAge(age);
    }

    public String toString() {
        return "Person [name=" + name + ", age=" + age + "]";
    }

}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Person[] pp = new Person[n];
        for (int i = 0; i < n; i++) {
            pp[i] = new Person(sc.next(), sc.nextInt());
        }
        String fid = sc.next();
        int flag = 0;
        for (int i = 0; i < n; i++) {
            System.out.println(pp[i].toString());
            if (pp[i].getName().equals(fid) == true) {
                flag = 1;
                System.out.println("查询结果：");
                System.out.println(pp[i].toString());
            }
        }
        if (flag == 0)
            System.out.println("not found");
        sc.close();
    }
}